<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="editor">
        hello editor
    </div>
    <script>
        const editor = document.getElementById('editor');
        editor.onclick = function () {
            // 1. 创建textarea多行文本
            const textarea = `<textarea>${editor.innerText}</textarea>`;
            // 2. 将texearea插入到editor
            editor.outerHTML = textarea;
        }





    </script>
</body>

</html>